package fourth;

import java.util.Arrays;
import java.util.Scanner;

public class seven_19 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("Enter the size: ");
        int n= input.nextInt();
        int[] arr = new int[n];
        System.out.println("Enter the list: ");
        for(int i=0;i<n;i++){
            arr[i]= input.nextInt();
        }
        System.out.println("The list is "+ Arrays.toString(arr));
        boolean flag = true;
        for(int i=0; i<n-1;i++){
            if(arr[i+1]<arr[i]) {
                flag=false;
                break;

            }
        }
        if(flag) System.out.println("The list is sorted");
        else System.out.println("The list is not sorted");
    }
}
